package com.atgm.mall.gmmallclub.controller;

import com.atgm.common.utils.PageUtils;
import com.atgm.common.utils.R;
import com.atgm.mall.gmmallclub.service.GameCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("gmmallclub/gamecomment")
public class GameCommentController {

    @Autowired
    private GameCommentService gameCommentService;

    @GetMapping("/getComment")
    public R getCommentByGameId(@RequestParam Map<String, Object> params) {
        PageUtils pageUtils = gameCommentService.queryCommentByGameId(params);
        return R.ok().setData(pageUtils);
    }

    @GetMapping("/updateThumbsCount/{id}/{count}")
    public R updateThumbsCount(@PathVariable("id") Long id, @PathVariable("count") Integer count) {
        gameCommentService.updateThumbsCount(id, count);
        return R.ok();
    }

}
